package com.connectr;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class Connectr extends Activity {
   
	private boolean is_connected = false;
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.main);
        
        this.findViewById(R.id.main_button).setOnClickListener(new OnClickListener(){
			public void onClick(View v) {
				
				Log.i(this.toString(), "On Click!");
				
				if(is_connected == false){
					TextView text = (TextView)findViewById(R.id.status_text);
					text.setText(R.string.scanning_string);
					
					Button btn = (Button)findViewById(R.id.main_button);
					btn.setText("Disconnect");
					
					is_connected = true;
					
				}else{
					TextView text = (TextView)findViewById(R.id.status_text);
					text.setText(R.string.inactive_string);
					
					Button btn = (Button)findViewById(R.id.main_button);
					btn.setText("Connect");
					
					is_connected = false;
				}
			}          	
        }); 
    }
}